home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet Info 1994 March
/
Internet Info CD-ROM (Walnut Creek) (March 1994).iso
/
networking
/
ip
/
ka9q
/
src.arc
/
AX25.H
< prev
next >
Wrap
C/C++ Source or Header
|
1989-08-19
|
5KB
|
133 lines
#ifndef NULLAXADDR
#include "global.h"
/* AX.25 datagram (address) sub-layer definitions */
#define NAXROUTE 5 /* Number of hash chains in routing table */
#define MAXDIGIS 7 /* Maximum number of digipeaters */
#define ALEN 6 /* Number of chars in callsign field */
#define AXALEN 7 /* Total AX.25 address length, including SSID */
/* Internal representation of an AX.25 address */
#ifndef SOCK_STREAM
struct ax25_addr {
char call[ALEN];
char ssid;
};
#endif
#define SSID 0x1e /* Sub station ID */
#define REPEATED 0x80 /* Has-been-repeated bit in repeater field */
#define E 0x01 /* Address extension bit */
#define C 0x80 /* Command/response designation */
#define NULLAXADDR (struct ax25_addr *)0
/* Our AX.25 address */
extern struct ax25_addr Mycall;
/* AX.25 broadcast address: "QST -0" in shifted ASCII */
extern struct ax25_addr Ax25_bdcst;
extern int Digipeat;
extern int Ax25mbox;
/* Internal representation of an AX.25 header */
struct ax25 {
struct ax25_addr dest; /* Destination address */
struct ax25_addr source; /* Source address */
struct ax25_addr digis[MAXDIGIS]; /* Digi string */
int ndigis; /* Number of digipeaters */
int cmdrsp; /* Command/response */
};
/* C-bit stuff */
#define UNKNOWN 0
#define COMMAND 1
#define RESPONSE 2
/* AX.25 routing table entry */
struct ax_route {
struct ax_route *prev; /* Linked list pointers */
struct ax_route *next;
struct ax25_addr target;
struct ax25_addr digis[MAXDIGIS];
int ndigis;
char type;
#define AX_LOCAL 1 /* Set by local ax25 route command */
#define AX_AUTO 2 /* Set by incoming packet */
};
#define NULLAXR ((struct ax_route *)0)
extern struct ax_route *Ax_routes[NAXROUTE];
extern struct ax_route Ax_default;
/* AX.25 Level 3 Protocol IDs (PIDs) */
#define PID_X25 0x01 /* CCITT X.25 PLP */
#define PID_SEGMENT 0x08 /* Segmentation fragment */
#define PID_TEXNET 0xc3 /* TEXNET datagram protocol */
#define PID_IP 0xcc /* ARPA Internet Protocol */
#define PID_ARP 0xcd /* ARPA Address Resolution Protocol */
#define PID_NETROM 0xcf /* NET/ROM */
#define PID_NO_L3 0xf0 /* No level 3 protocol */
#define SEG_FIRST 0x80 /* First segment of a sequence */
#define SEG_REM 0x7f /* Mask for # segments remaining */
/* Codes for the open_ax25 call */
#define AX_PASSIVE 0
#define AX_ACTIVE 1
#define AX_SERVER 2 /* Passive, clone on opening */
/* In ax25.c: */
struct ax_route *ax_add __ARGS((struct ax25_addr *,int,struct ax25_addr *,int));
int ax_drop __ARGS((struct ax25_addr *));
struct ax_route *ax_lookup __ARGS((struct ax25_addr *));
void ax_recv __ARGS((struct iface *,struct mbuf *));
int ax_send __ARGS((struct mbuf *bp,struct iface *iface,int32 gateway,int prec,
int del,int tput,int rel));
int ax_output __ARGS((struct iface *iface,char *dest,char *source,int16 pid,
struct mbuf *data));
void axarp __ARGS((void));
int sendframe __ARGS((struct ax25_cb *axp,int cmdrsp,int ctl,struct mbuf *data));
/* In ax25cmd.c: */
int axnrconnect __ARGS((struct session *sp,char *fsocket,int len));
void axnrhandle __ARGS((int s,void *t,void *p));
void st_ax25 __ARGS((struct ax25_cb *axp));
/* In ax25user.c: */
int ax25val __ARGS((struct ax25_cb *axp));
int disc_ax25 __ARGS((struct ax25_cb *axp));
int kick_ax25 __ARGS((struct ax25_cb *axp));
struct ax25_cb *open_ax25 __ARGS((struct iface *,struct ax25_addr *,struct ax25_addr *,
int,int16,
void (*) __ARGS((struct ax25_cb *,int)),
void (*) __ARGS((struct ax25_cb *,int)),
void (*) __ARGS((struct ax25_cb *,int,int)),
int user));
struct mbuf *recv_ax25 __ARGS((struct ax25_cb *axp,int16 cnt));
int reset_ax25 __ARGS((struct ax25_cb *axp));
int send_ax25 __ARGS((struct ax25_cb *axp,struct mbuf *bp,int pid));
/* In ax25subr.c: */
int addreq __ARGS((struct ax25_addr *a,struct ax25_addr *b));
int atohax25 __ARGS((struct ax25 *hdr,char *hwaddr,struct ax25_addr *source));
struct ax25_cb *cr_ax25 __ARGS((struct ax25_addr *addr));
void del_ax25 __ARGS((struct ax25_cb *axp));
struct ax25_cb *find_ax25 __ARGS((struct ax25_addr *));
char *getaxaddr __ARGS((struct ax25_addr *ap,char *cp));
struct mbuf *htonax25 __ARGS((struct ax25 *hdr,struct mbuf *data));
int ntohax25 __ARGS((struct ax25 *hdr,struct mbuf **bpp));
int pax25 __ARGS((char *e,struct ax25_addr *addr));
int psax25 __ARGS((char *e,char *addr));
char *putaxaddr __ARGS((char *cp,struct ax25_addr *ap));
int setcall __ARGS((struct ax25_addr *out,char *call));
int setpath __ARGS((char *out,char *in));
/* In socket.c: */
void beac_input __ARGS((struct iface *iface,struct ax25_addr *src,struct mbuf *bp));
void s_arcall __ARGS((struct ax25_cb *axp,int cnt));
void s_ascall __ARGS((struct ax25_cb *axp,int old,int new));
void s_atcall __ARGS((struct ax25_cb *axp,int cnt));
#endif /* NULLAXADDR */